@isTest
private class RemoteTKTestSuite{
    static testMethod void runPositiveTestCases(){
      //Set up user
        User u1 = [SELECT Id From User where Alias = 'lmons'];
        System.RunAs(u1){
         //Insert new account for testing
          Account a = new Account(Name = 'Adriana Monsivais',Employee_Status__c='Active'); 
          insert a;
          Account newAcc = [SELECT id 
                            FROM Account 
                            WHERE CreatedDate = TODAY 
                            AND CreatedById = :u1.id LIMIT 1];
                                
          System.debug(newAcc.id);
          //testing positive results for describe
          System.debug(RemoteTKController.describe('Account')); 
          //testing negative results for describe
          System.debug(RemoteTKController.describe('Cuentas')); 
          //testing positive results for query
          System.debug(RemoteTKController.query('SELECT Name FROM Account LIMIT 1'));
          //testing negative results for query
          System.debug(RemoteTKController.query('SELECT Names FROM Account LIMIT 1'));
          //testing positive results for search
          System.debug(RemoteTKController.search('FIND \'Mariana*\' IN ALL FIELDS RETURNING Account(id,name)')); 
          //testing negative results for search
                    
          //testing negative results for updat
          System.debug(RemoteTKController.updat('Account',newAcc.id,'{"Jigsaw":"1234567890123456789012345"}'));
          System.debug(RemoteTKController.retrieve('Account',newAcc.id,'id,Name,Jigsaw'));
          System.debug(RemoteTKController.updat('Cuentas',newAcc.id,'{"Names":"Adriana M"}'));          
          System.debug(RemoteTKController.updat('Account',newAcc.id,'{"Names":"Adriana M"}'));
          System.debug(RemoteTKController.updat('Account',newAcc.id,'{"Name","Adriana M"}'));
          
                    
           //testing negative results for create
          System.debug(RemoteTKController.create('Account','{"Name":""}'));
          System.debug(RemoteTKController.create('Cuentas','{"Name":"New Test Account","Employee_Status__c":"Active"}'));                          
          System.debug(RemoteTKController.create('Account','{"Name":"New Test Account","Employee_Status":"Active"}'));
          System.debug(RemoteTKController.create('Account','{"Name":"New Test Account","Employee_Status","Active"}'));
          //testing positive results for create
          System.debug(RemoteTKController.create('Account','{"Name":"New Test Account","Employee_Status__c":"Active"}'));
          
          //testing negative results for ApprovalProc 
          System.debug(RemoteTKController.ApprovalProc(newAcc.id));
          //testing positive results for updat
          System.debug(RemoteTKController.updat('Account',newAcc.id,'{"Employee_Status__c":"Dismissed"}'));     
          //testing positive results for ApprovalProc (it's needed Employee_Status__c != Active
          System.debug(RemoteTKController.ApprovalProc(newAcc.id));               
          
          //testing positive results for retrieve
          System.debug(RemoteTKController.retrieve('Account',newAcc.id,'id,Name,Description'));
          //testing negative results for retrieve
          System.debug(RemoteTKController.retrieve('Account',newAcc.id,'Name,Employee_Status__c'));
          System.debug(RemoteTKController.retrieve('Account',newAcc.id,'Name,Employee_Status_c'));
          
          //testing negative results for del
          System.debug(RemoteTKController.del('Cuentas',newAcc.id));
          System.debug(RemoteTKController.del('Account','123456789012345678'));
          //steps for testing a negative result for del
          System.debug(RemoteTKController.create('Position__c','{"Name":"New Position","Description__c":"Testing purpose"}')); 
          Position__c newPos = [SELECT id 
                                FROM Position__c 
                                WHERE CreatedDate = TODAY 
                                AND CreatedById = :u1.id LIMIT 1];
                                
          System.debug(newPos.id); 
          System.debug(RemoteTKController.updat('Account',newAcc.id,'{"Position__c":"'+newPos.id+'"}'));    
          System.debug(RemoteTKController.del('Position__c',newPos.id));                   
          //testing positive results for del
          System.debug(RemoteTKController.del('Account',newAcc.id)); 

          

        
        }    
    
    }
  



}